QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Orientation Styles

A model's orientation style determines which side of a planar surface is considered to be the "front" side. QuickDraw 3D defines constants for the orientation styles that are currently available.

typedef enum TQ3OrientationStyle {
    kQ3OrientationStyleCounterClockwise,
    kQ3OrientationStyleClockwise
} TQ3OrientationStyle;

The default value, kQ3OrientationStyleCounterClockwise , specifies that the front face of a polygonal shape is that face whose vertices are listed in counterclockwise order. The constant kQ3OrientationStyleClockwise specifies that the front face of a polygonal shape is that face whose vertices are listed in clockwise order. Figure 1 shows the front of a polygonal face.

Figure 1 The front side of a polygon

The cross product of the vectors formed by the first two edges (that is, by the segments from A to B and from B to C) points straight out of the page, indicating that this is the front side of the polygon. The renderer will use this information for operations such as culling and shading. If you change the orientation style to clockwise, you must make sure that the polygonal shape corresponds.

The orientation style affects only explicitly polygonal geometric primitives, such as triangles, simple and general polygons, and polyhedral primitives. It does not affect the appearance of other primitives, such as cyclinders and NURB patches, and these primitives need not be converted to polygonal shapes for rendering, picking, bounding, or similar operations.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |